-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
audit: NM audit fixes +ISolverHooks
refactor
#5
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parketh
changed the title
audit: fixes from NM audit review
audit: NM audit fixes + Jul 11, 2024
ISolverHooks
interface
parketh
changed the title
audit: NM audit fixes +
audit: NM audit fixes + updates to Jul 11, 2024
ISolverHooks
interfaceISolverHooks
interface
parketh
changed the title
audit: NM audit fixes + updates to
feat: NM audit fixes +Jul 11, 2024
ISolverHooks
interfaceISolverHooks
interface refactor
parketh
changed the title
feat: NM audit fixes +
NM audit fixes +Jul 11, 2024
ISolverHooks
interface refactorISolverHooks
interface refactor
parketh
changed the title
NM audit fixes +
NM audit fixes +Jul 11, 2024
ISolverHooks
interface refactorISolverHooks
refactor
parketh
changed the title
NM audit fixes +
audit: NM audit fixes +Jul 11, 2024
ISolverHooks
refactorISolverHooks
refactor
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR contains:
ISolverQuoter
->ISolverHooks
interface to allow custom state updates after swaps executeAudit fixes
assert_market_owner()
check to prevent non-owner withdrawals from private vaults. We also add a new test case to prevent future regression of this access control check.max_delta
params. Contract admin will now be able to set a delay (in seconds) which must pass before queued market parameter updates are set. The delay is skipped if market params are being initialised for the first time.u32
underflowquote()
function toswap()
i32
implementation (no code changes)withdraw()
->withdraw_private()
andwithdraw_at_ratio()
->withdraw_public()
for clarity, and add some test casesFull details documented here.
ISolverHooks
refactorThe
ISolverQuoter
interface provided a read-onlyquote()
function to compute the swap amounts for execution byswap()
.However, custom solver implementations may also wish to execute their own state updates after swaps occurs, for example to record new internal values based on the swapped amounts.
To achieve this, we add a new function
after_swap()
that is called at the end ofswap()
execution to accomodate custom solver logic. Note thatafter_swap()
is only callable by the contract itself. We add a reentrancy guard to prevent unwanted callers, which is toggled on / off before and after execution.We also rename the interface
ISolverHooks
to better reflect its purpose.Testing